import {
	data
} from "../../uni_modules/uview-ui/libs/mixin/mixin"
import {
	request,
	GET,
	POST,
	PUT,
	PATCH,
	DELETE
} from "../interceptor"
import base from '@/base/index.js'


function get(url, data, config) {
	return request(GET, url, data, config)
}

function post(url, data, config) {
	return request(POST, url, data, config)
}


let api = {
	// ===================================================================登录、用户信息
	//短信验证码
	gate_sms_send: data => post('/Sms/send', data),
	//注册
	gate_user_register: data => post('/User/register', data),
	//账号密码登录
	gate_user_login: data => post('/user/login', data),
	//短信验证码登录
	gate_user_mobilelogin: data => post('/user/mobilelogin', data),
	//退出登录		
	gate_user_logout: data => post('/user/logout', data),
	//更换手机号
	gate_user_changemobile: data => post('/user/changemobile', data),
	//修改密码
	gate_user_changepwd: data => post('/user/changepwd', data),
	//忘记密码
	gate_user_resetpwd: data => post('/user/resetpwd', data),
	//实名认证 
	auth_user_info: data => post('/User/realname', data),
	//获取实名认证信息
	get_user_realInfo: data => get('/User/getRealname', data),
	//完善用户微信信息
	update_user_info: data => post('/Wechat/setUserinfo', data),
	//获取后台配置信息
	get_wechat_config: data => get('/wechat/config', data),
	//注销
	get_user_zhuxiao: data => post('/user/zhuxiao', data),
	//绑定微信
	get_wechat_code: data => get('/wechat/login', data),
	//获取用户信息
	get_user_info: data => get('/user/getUserInfo', data),
	//农户注册认证
	get_face_newFarmer: data => post('/Face/newFarmer', data),
	//农户注册获取短信验证码
	get_face_smsSend: data => post('/Face/send', data),


	// ===================================================================上传文件
	// 文件上传-地址
	file_upload_path: base.baseUrl + '/Common/upload',

	// ===================================================================地址管理
	//添加地址 姜厂信息
	get_address_factory: data => get('/Address/factory', data),
	//添加地址
	save_address_add: data => post('/Address/add', data),
	//修改地址信息
	save_address_edit: data => post('/Address/edit', data),
	//删除地址信息
	post_address_del: data => post('/Address/del', data),
	//获取默认地址信息
	get_address_default: data => get('/Address/getdefultAddress', data),
	//获取地址列表
	get_address_list: data => get('/Address/myList', data),



	// ===================================================================首页
	//过磅信息
	get_wight_list: data => post('/Weight/myList', data),
	//过磅信息 详情
	get_wight_info: data => post('/Weight/info', data),
	//过磅信息汇总
	get_weigh_mySummary: data => get('/Weight/mySummary', data),
	//过磅信息 回皮
	post_weigh_huipi: data => post('/Weight/huipi', data),
	//消息列表
	get_user_message: data => post('/user/message', data),
	//消息详情
	get_user_messageInfo: data => post('/user/messageInfo', data),
	//未读消息数
	get_user_messageNum: data => get('/User/messageNum', data),
	//获取二维码
	get_user_qrcode: data => post('/User/getQrcode', data),
	//余额记录
	get_wechat_moneylog: data => post('/wechat/moneylog', data),
	//提现
	get_wechat_withdraw: data => post('/wechat/withdraw', data),
	//充值
	get_wechat_recharge: data => post('/wechat/recharge', data),


	// ===================================================================包材商城
	//商品分类
	get_shop_goodsCate: data => get('/Fshop/goodscate', data),
	//商品列表
	get_shop_goodsList: data => post('/Fshop/goodslist', data),
	//商品详情
	get_shop_goodsDetail: data => post('/Fshop/goodsDetail', data),
	// 浏览记录
	get_shop_viewLogs: data => get('/Fshop/viewlogs', data),
	//添加购物车
	get_shop_addCart: data => post('/Fshop/addcart', data),
	//购物车列表
	get_shop_cartList: data => get('/Fshop/cartList', data),
	//购物车修改
	edit_shop_editCart: data => post('/Fshop/cartEdit', data),
	//购物车删除记录
	del_shop_cartDel: data => post('/Fshop/cartDel', data),
	//商品直接购买
	submit_shop_buy: data => post('/Fshop/buy', data),
	//购物车下单
	submit_shop_cartBuy: data => post('/Fshop/cartBuy', data),

	// ===================================================================订单
	//订单列表
	get_order_list: data => post('/Fshop/orderList', data),
	//订单状态
	get_order_status: data => get('/Fshop/orderstatus', data),
	//订单详情
	get_order_detail: data => post('/Fshop/orderDetail', data),
	//取消订单
	cancel_order: data => post('/Fshop/cancelOrder', data),
	//待收货订单数量
	get_receipt_orderNum: data => post('/Fshop/orderNum', data),
	//确认收货
	get_receipt_order: data => post('/Fshop/receiptOrdergoods', data),
	//申请退款
	get_refund_order: data => post('/Fshop/refundOrdergoods', data),
	//订单支付
	pay_order: data => post('/Fshop/payOrder', data),
	//取消申请退款
	cancel_refund_order: data => post('/Fshop/cancelRefundOrdergoods', data),
	// 已注册列表
	get_Face_facelist: data => get('/Face/facelist', data),

	//=============================================================其他
	// 获取版本
	get_versionInfo: data => get('/index/version', data)
}

export default {
	api
}